package cn.ly.recursion.anagram;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 颠倒字母顺序
 * @author liuyu21
 *
 */
public class Anagram {
	static int size;
	static int count;
	static char[] arrChar = new char[100];
	
	public static void main(String[] args) throws IOException {
		System.out.println("Enter a number:");
		String str = getInputString();
		size = str.length();
		count = 0;
		for(int j = 0; j < size; j++){
			arrChar[j] = str.charAt(j);
		}
	}
	
	public static char[] doAnagram(char[] arr,int len){
		if(arr.length == 1){
			return arr;
		}else{
			for(int i=0; i<len; i++){
				doAnagram(getNewArr(arr,len),len-1);
			}
		}
		return arr;
	}
	
	public static char[] getNewArr(char[] arr,int len){
		for(int i = 0; i < len-1; i++){
			arr[i] = arr[i+1];
		}
		return arr;
	}
	
	public static String getInputString() throws IOException{
		InputStreamReader reader = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(reader);
		return br.readLine();
	}
	

}
